home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2198 < prev    next >
Encoding:
Text File  |  1996-08-05  |  990 b   |  45 lines

  1. Path: nntp.coast.net!torn!nott!uottawa!u637018
  2. From: u637018@csi.uottawa.ca (Daniel Lortie)
  3. Newsgroups: comp.lang.c
  4. Subject: how to use farmalloc() structures? HELP!!!
  5. Date: 19 Jan 1996 17:24:39 GMT
  6. Organization: Dept. of Computer Science, University of Ottawa
  7. Message-ID: <4dok4n$plc@mercury.cc.uottawa.ca>
  8. NNTP-Posting-Host: csia.csi.uottawa.ca
  9. Mime-Version: 1.0
  10. Content-Type: Text/Plain; charset=ISO-8859-1
  11. Content-Transfer-Encoding: 8bit
  12.  
  13. How can I use the farmalloc() function for allocating memory in
  14. a compact memory model, for a structure.  This is what I tried
  15. but does not work on Turbo C
  16.  
  17. This is what I use when using malloc (not far allocation - limited to 64k)
  18. (How would I use farmalloc() ???)
  19. struct dbllist {
  20.   ...
  21.   ...
  22.   ...
  23.   };
  24.  
  25. typedef dbllist sched;
  26. typedef sched *psched;
  27.  
  28. ...
  29. ...
  30.  
  31. main(void)
  32. {
  33.   psched newrec;
  34.  
  35.   newrec = (psched) malloc(sizeof(sched));
  36.   ...
  37.   ...
  38. }
  39.  
  40. Any thoughts appreciated!!!
  41. Daniel Lortie
  42. u637018@csi.uottawa.ca
  43. Daniel@admin.coop.uottawa.ca
  44.  
  45.